<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title></title>
</head>
<body>

<input type="text" id="text" />
<script>
document.getElementById("text").focus();
if(document.hasFocus()){
	document.activeElement.style.backgroundColor = "yellow";
}
</script>




</body>
</html>
